package org.vectrics.common.db;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class OverlapValidationProblem extends ValidationProblem {
	private List expirablesWithOverlap = new ArrayList();
	

	public String getDescription() {
		StringBuffer str = new StringBuffer();
		str.append("Overlapping objects: ");
		Iterator iter = expirablesWithOverlap.iterator();
		while (iter.hasNext()) {
			Expirable expirable = (Expirable)iter.next();
			str.append("\r\n  - - " + expirable + ": [" + expirable.getDateStart() + "] to [" + expirable.getDateEnd() + "]" );
			
		}
		return(str.toString());
	}

	public void addExpirable(Expirable expirable) {
		this.expirablesWithOverlap.add(expirable);
	}
}
